package com.atguigu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author wk
 * @create 2021-06-08 23:14
 * 设置统一资源定位符+请求方式 更准确地描述要操作的逻辑
 *
 *
 *发送PUT和DELETE请求需要满足两个请求
 * 1.设置HiddenHttpMethodFilter过滤器   在web.xml配置文件中配置
 * 2.传入参数_method 而且_method请求参数的值必须为put或delete或patch  在form表单中以隐藏域的方式表示
 *
 */
@Controller
public class RestTest {
    @RequestMapping(value = "/testGet",method = RequestMethod.GET)
    public String testGet(){
        return "success";
    }
    @RequestMapping(value = "/testPost",method = RequestMethod.POST)
    public String testPost(){
        return "success";
    }

    @RequestMapping(value = "/testPut",method = RequestMethod.PUT)
    public String testPut(){
        return "success";
    }
    @RequestMapping(value = "/testDelete",method = RequestMethod.DELETE)
    public String testDelete(){
        return "success";
    }
}
